package solutions.face.easy;

import solutions.lib.BaseSolution;

/**
 * @author lizhidong
 * <a href="https://leetcode-cn.com/problems/B1IidL/">剑指 Offer II 069. 山峰数组的顶部</a>
 */
public class Sotion2_169 extends BaseSolution {


    public int peakIndexInMountainArray(int[] arr) {
        int p = 0;
        while (p < arr.length) {
            if (arr[p] > arr[p + 1]) {
                return p;
            }
            p++;
        }
        return 0;
    }

    public static void main(String[] args) {
        Sotion2_169 solution = new Sotion2_169();
    }
}